import { createRouter, createWebHashHistory } from 'vue-router'
import UserLayout from '@/layouts/UserLayout'

// 静态路由
const constantRoutes = [{
  path: '/login',
  redirect: '/login',
  component: UserLayout,
  meta: {
      title: '登录'
  },
  children: [
    {
      path: '/login',
      name: 'login',
      component: () => import('@/views/login/index'),
    },
  ]
},
{
  path: '/404',
  name: '404',
  component: () => import('@/views/404'),
  meta: {
      title: '404'
  }
}
]

const router = createRouter({
  history: createWebHashHistory(),
  routes: constantRoutes
})

export function resetRouter() {
  const newRouter = router
  router.matcher = newRouter.matcher
}


export default router
